<%-- Copyright (c) 2002 BroadVision, Inc. All rights reserved              --%>
<%-- The product described in this manual may be protected by one or more  --%>
<%-- U.S. and International patents. The BroadVision One-To-One software   --%>
<%-- is covered by U.S. patent 5,710,887.                                  --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and the BroadVision logo are registered       --%>
<%-- trademarks, and BroadVision One-To-One is a trademark of BroadVision, --%>
<%-- Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,    --%>
<%-- MD5, and RC2 are trademarks of RSA Data Security, Inc. All other      --%>
<%-- trademarks, service marks, and trade names belong to their respective --%>
<%-- owners. BroadVision, Inc. disclaims any proprietary interest in the   --%>
<%-- marks and names of others.                                            --%>
<%--                                                                       --%>


<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


<c:set var="formBean" value="${emSegmentBrowseForm}" />
<c:set var="formBeanMap" value="${formBean.map}" />

<c:set var="viewBean" value="${emSegmentBrowseView}" />
<c:set var="viewBeanMap" value="${viewBean.map}" />
<bean-el:size id="segmentListSize" name="viewBean" property="segmentList"/>

<c:set var="breadcrumbRootLink">
  <c:url var="rootBrowseUrl" value="/em/segment/segmentBrowse.do">
    <c:param name="currentCategoryOid" value="0"/>
  </c:url>
  <a href='<c:out value="${rootBrowseUrl}" escapeXml="false" />'><bean-el:message bundle="em" key="em.category.root" /></a>
</c:set>

<c:set var="breadcrumbCategorySeparator">
  &nbsp;<bean-el:message bundle="em" key="em.category.separator" />&nbsp;
</c:set>
<script language="javascript" src="<%=request.getContextPath()%>/mc/js/date.js"></script>

<jsp:include page="/mt/common/pickerPopupHelper.jsp" flush="true" />


<!--start zone 5 content area-->
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
        <bean-el:message bundle="em" key="em.segment.title.browse"/>
      </div>
      <div class="errorMessage"><html:errors bundle="em"/></div>

      <jsp:include page="/mc/common/pagetab.jsp" flush="true" />

      <c:set var="breadcrumbs" value="${viewBeanMap.breadcrumbs}" scope="request" />
      <%request.setAttribute("lastNeedLink", Boolean.FALSE);%>
      <jsp:include page="/em/segment/segmentBreadcrumbs.jsp" flush="true" />

      <html:form action="/em/segment/segmentCategoryNew.do">
        <input type=hidden name="parentCategoryOid" value='<c:out value="${formBeanMap.currentCategoryOid}"/>'>

        <div class="pageSubtitle">
          <span class="left">
            <bean-el:message bundle="em" key="em.segment.browse.subcategory" />
          </span>
          <span class="right">
            <input type="submit" class="inputButton"
             value="<bean-el:message bundle="em" key="em.segment.button.categorize.newCategory"/>" >
          </span>
        </div>
      </html:form>

      <html:form action="/em/segment/segmentBrowse.do">
        <html:hidden property="currentCategoryOid"/>
      </html:form>

      <c:set var="categoryList" value="${viewBeanMap.categories}" scope="request" />
      <jsp:include page="/em/segment/segmentCategorizeCatListInclude.jsp" flush="true" />

      <c:if test="${formBeanMap.currentCategoryOid != 0}" >
        <!-- Start segment display -->
        <div class="pageSubtitle">
          <!-- Start Subtitle for segment display -->
          <span class="left">
            <bean-el:message bundle="em" key="em.segment.browse.segments" 
               arg0="${viewBeanMap.currentCategoryName}" />
          </span>
          <!-- End Subtitle for segment display -->
  
          <!-- Start New Segment Button -->
          <span class="right">
            <!-- if no permit to create segment, disable create button -->
            <c:if test="${viewBeanMap.createType}">
              <html:form action="/em/segment/segmentNew.do">
                <html:hidden name="emSegmentBrowseForm" property="currentCategoryOid"/>
                <input type="submit"  name="newSegment" class="inputButton"
                  value="<bean-el:message bundle="em" key="em.segment.button.browse.newSegment"/>">
              </html:form>
            </c:if>
          </span>
          <!-- End New Segment Button -->

        </div>
        <c:set var="segmentList" value="${viewBeanMap.segmentList}" scope="request" />
        <jsp:include page="/em/segment/segmentListSection.jsp" flush="true"/>
      </c:if>
    </td>
  </tr>
</table>

<!--end main content area here-->
